#include "ros/ros.h"
#include <string>

#include <ros1_protobuf_msg_bridge/msg/Header.h>

int main(int argc, char **argv) {
    ros::init(argc, argv, "talker");

    ros::NodeHandle n;
    ros::Publisher pubNode = n.advertise<ros1_protobuf_msg_bridge::Header>("t_pub1", 1000);

    ros::Rate loop_rate(10);

    ros1_protobuf_msg_bridge::Header pd;

    int count = 0;
    while (ros::ok()) {
        // 测试Header
        pd.set_timestamp(count * 10);
        pd.set_frame_id("frame_id" + std::to_string(count));
        pubNode.publish(pd);

        ROS_INFO("str data2: %s", pd.frame_id().c_str());
        ros::spinOnce();
        loop_rate.sleep();
        ++count;
        count = count % 15;
    }

    return 0;
}
